package com.glsc.ngateway.common.base.repo.oracle.ecology;

import com.glsc.ngateway.common.base.domain.oracle.ecology.Hrmdepartment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface HrmdepartmentRepository extends JpaRepository<Hrmdepartment, Integer>, JpaSpecificationExecutor<Hrmdepartment> {
    Optional<Hrmdepartment> findByDepartmentname(String departmentname);

    @Query(value = "select * from HRMDEPARTMENT where id in (:oaDepartmentIdList)", nativeQuery = true)
    List<Hrmdepartment> findAllByIdList(List<Integer> oaDepartmentIdList);

    List<Hrmdepartment> findAllByOutkeyNotNull();

}
